<link rel="stylesheet" href="${ctxPath}/css/pages/template_view.css"/>
<script type="text/javascript" src="${ctxPath}/js/pages/template_view.js"></script>
<div class="pageheader">
    <h2><i class="fa fa-table"></i> 模板管理 <span>模板详情一览.</span></h2>

    <div class="breadcrumb-wrapper">
        <span class="label">当前位置:</span>
        <ol class="breadcrumb">
            <li><a href="index.html">Bracket</a></li>
            <li class="active">模板管理</li>
        </ol>
    </div>
</div>

<div class="contentpanel">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">模板详情一览</h3>

            <p>采用列表展示上传的所有的网页模板，可以浏览、修改，删除网页模板的信息，但是上传需要点击左侧菜单在新页面进行操作。<a href="../template/template_dashboard.html" target="_blank">查看模板首页</a></p>

        </div>
        <div class="panel-body">
            <div class="table-responsive">
                <table class="table mb30 table-striped" id="template_view_table">
                    <thead>
                    <tr>
                        <th class="col-md-2">模板名称</th>
                        <th class="col-md-2">模板缩略图</th>
                        <th class="col-md-1">浏览</th>
                        <th class="col-md-3">模板描述</th>
                        <th class="col-md-1">模板标签</th>
                        <th class="col-md-3">模板操作</th>
                    </tr>

                    </thead>
                    <tbody>
                    <%for(templateVo in templateList){
                    if(templateVoLP.odd){%>
                    <tr id="template_${templateVo.template_id}" class="odd gradeX">
                        <%}else{%>
                    <tr id="template_${templateVo.template_id}" class="even gradeC">
                        <%}%>
                        <td class="center col-md-2">${templateVo.template_name}</td>
                        <td class="center col-md-2"><a href="#" class="thumbnail"><img
                                data-src="holder.js/100x100" alt=""
                                src="${ctxPath}/${templateVo.template_snapshot}"/></a></td>

                        <td class="center col-md-1">${templateVo.templaye_browser_num}</td>
                        <td class="center col-md-3">${templateVo.template_describe}</td>
                        <td class="center col-md-1">${templateVo.template_tip}</td>
                        <td class="center col-md-3">
                            <button class="btn btn-info"
                                    onclick="showTemplate('${ctxPath}/${templateVo.template_access_url}')"><i
                                    class="glyphicon glyphicon-eye-open"></i></button>
                            <button class="btn btn-primary"
                                    onclick="editTemplate('${templateVo.template_id}')"><i
                                    class="fa fa-pencil"></i></button>
                            <button class="btn btn-danger"
                                    onclick="delTemplate('${templateVo.template_id}')"><i class="fa fa-trash-o"></i>
                            </button>
                        </td>
                        <%}%>
                    </tbody>
                </table>
            </div>
            <!-- table-responsive -->
        </div>
        <!-- panel-body -->
    </div>
    <!-- panel -->
</div><!-- contentpanel -->
<!--内嵌模板进行显示-->
<div id="template_browser_dialog" class="modal fade">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">浏览模板页面</h4>
            </div>
            <div class="modal-body">
                <div class="embed-responsive embed-responsive-16by9">
                    <iframe class="embed-responsive-item"></iframe>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div><!-- /.modal -->
<!--模板内容进行编辑-->
<div id="template_edit_dialog" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">模板内容编辑</h4>
            </div>
            <div class="modal-body">
                <div class="form-horizontal">
                    <div class="form-group">
                        <label for="edit_tamplateName" class="col-sm-2 control-label">模板名称&nbsp;*&nbsp;</label>

                        <div class="col-sm-10">
                            <input type="email" class="form-control" id="edit_tamplateName" name="tamplateName"
                                   placeholder="修改模板名称">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="edit_tamplateTips" class="col-sm-2 control-label">模板标签&nbsp;*&nbsp;</label>

                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="tamplateTips" id="edit_tamplateTips"
                                   placeholder="重写模板标签">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="edit_tamplateDescribe" class="col-sm-2 control-label">模板描述&nbsp;*&nbsp;</label>

                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="edit_tamplateDescribe" name="tamplateDescribe"
                                   placeholder="模板描述">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" id="edit_templateSubmitBtn" class="btn btn-primary">
                    保存
                </button>
                <button type="button" class="btn btn-info" data-dismiss="modal">
                    关闭
                </button>
            </div>
        </div>
    </div>
    <!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div><!-- /.modal -->

